<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="">
  
  <xsl:import href="../../common/base.xsl"/>
	<xsl:import href="../style/web.xsl"/>
  
	<xsl:param name="def"/>
	<xsl:param name="action"/>
	
  <xsl:template match="/*">
  	<html>
  		<head>
  			<title>Index <xsl:value-of select="$def"/></title>
  			<style type="text/css">
          html {
            background-color: <xsl:value-of select="if (exception) then '#FFEEEE' else '#EEFFEE'"/>;
            font-family: Verdana, Arial, Helvetica, sans-serif;
          }
        </style>
  		</head>
  		<body>
  			<xsl:if test="not(exception)">
  				<xsl:attribute name="onblur" select="'window.close()'"/>
  			</xsl:if>
  			<p>The <xsl:value-of	select="$action"/> of the index <xsl:value-of select="$def"/>
  			has been <xsl:value-of select="if (exception) then 'only partly' else ''"/> successfull.</p>
  			<xsl:apply-templates select="exception" mode="root"/>
  			<p><a href="#" onclick="window.close()" title="Close this window">[close window]</a></p>
  		</body>
  	</html>
  </xsl:template>
	
	<xsl:template match="exception" mode="root">
		<p style="font-size: 80%; font-family: monospace;">
			<xsl:value-of select="position()"/>: <xsl:value-of select="message"/>
			<xsl:if test="not(message)"><xsl:value-of select="@type"/></xsl:if>
			<xsl:apply-templates select="exception"/>
		</p>
	</xsl:template>
	
	<xsl:template match="exception">
		<br/>
		<xsl:for-each select="ancestor::exception">&#160;&#160;</xsl:for-each>
		<xsl:value-of select="message"/>
		<xsl:if test="not(message)"><xsl:value-of select="@type"/></xsl:if>
		<xsl:apply-templates select="exception"/>
	</xsl:template>
	
</xsl:stylesheet>
